import axios from "@u/request";

// 请求首页轮播
const fetchHomeBanner = (params = {})=> (
  axios.get('/banner/list', {params})
)
// 请求分类数据
const fetchCates = (params = {})=> (
  axios.get('/shop/goods/category/all', {params})
)
// 请求商品列表
const fetchItems = (params = {})=> (
  axios.post('/shop/goods/list/v2', params)
)
// 获取商品详情
const fetchItemDetail = (id: string)=> (
  axios.get('/shop/goods/detail', {params: {id}})
)
// 用户注册
const userReg = (params = {})=> (
  axios.post('/user/username/register', params)
)
// 用户登录
const userLogin = (params = {})=> (
  axios.post('/user/username/login', params)
)
export {
  fetchHomeBanner,
  fetchCates,
  fetchItems,
  fetchItemDetail,
  userReg,
  userLogin
}